﻿@{
    Layout = null;
}
@using ZBJF.Warranty.WebProvider.AdminPemission
@model List<ZBJF.Warranty.Model.InsuranceWarrantyRecordStatus>
@foreach (var item in Model.Where(m => m.ParentId == ViewBag.Pid))
{
    int layer = ViewBag.Layer;
    var paddingLeft = 30 * layer + "px";
    <tr layer="@layer">
        <td class="category">
            @if (Model.Where(m => m.ParentId == item.ID).Count() > 0)
            {
                <span class="close" attr-id="close" style="margin-left: @paddingLeft" onclick="categoryTree(this, @layer)"></span>
            }
            else
            {
                <span attr-id="close" style="margin-left: @paddingLeft" ></span>
            }
            @item.StatusName
        </td>
        <td>@item.StatusCode</td>
        <td>
            @if (item.IsAvailable == true)
            {
                <i class="icon-ok green bigger-120"></i>
            }
            else
            {
                <i class="icon-remove red bigger-120"></i>
            }
        </td>
        <td>@item.LastModifyBy</td>
        <td>@item.LastModifyTime</td>
        <td>
            @if (item.ParentId > 0)
            {
                @*<a href="javascript:ShowEidtDialog('@item.ID','@item.StatusName','@item.StatusCode','@item.ParentId',@(item.IsAvailable ? "true" : "false"))" class="Edit-R" title="编辑">
                    <i class="icon-pencil green bigger-120"></i>
                </a>*@
                <a class='Edit-R' href="javascript:UpdateInsuranceWarrantyRecordStatus('@item.ID',@(item.IsAvailable ? "false" : "true"),'/InsuranceWarrantyDealWith/InsuranceWarrantyRecordStatusUpdateStatus')" title='@(item.IsAvailable ? "禁用" : "启用")'>
                    @(item.IsAvailable ? Html.Raw("<i class='icon-remove'></i>") : Html.Raw("<i class='icon-ok'></i>"))
                </a>
            }
            else
            {
                <a class='Edit-R' href="javascript:showAddNewAdmin(@item.ID);" title='添加新字段'>
                    <i class='icon-plus'></i>
                </a>

            }

        </td>
    </tr>
                var childMenu = Model.Where(m => m.ParentId == item.ID).ToList();
                layer = layer + 1;
                if (childMenu.Any())
                {
                    @Html.Action("ShowStatusList", "InsuranceWarrantyDealWith", new { listPage = Model, pid = item.ID, layer = layer })
                    }
                    layer = layer - 1;
                }